{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<style>
    .layui-laydate-header{
        display: none;
    }
    .layui-laydate-content> table>thead{
        display: none;
    }
    .laydate-day-prev{
        display: none;
    }
    .laydate-day-next{
        display: none;
    }
</style>
<form class="layui-form p-4">
    <h3 class="pb-3">功能菜单/节点</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">客户名称<font>*</font>
            </td>
            <td>
                <select name="purveyorId"  lay-search>
                    {volist name='punterList' id='pl'}
                    <option value="{$pl.id}">{$pl.name}</option>
                    {/volist}
                </select>
            </td>
            <td class="layui-td-gray">沟通人姓名<font>*</font>
            </td>
            <td>
                <input type="text" name="vName" value="{$detail.vName|default=''}"   lay-verify="required" autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
            <td class="layui-td-gray-2">沟通人职位<font>*</font>
            </td>
            <td>
                <input type="text" name="vJob" value="{$detail.vJob|default=''}" lay-verify="required"   autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
        </tr>
        <tr>

            <td class="layui-td-gray">拜访时间<font>*</font>
            </td>
            <td>
                <input type="text"  name="vTime" id="vTime" readonly value="{$detail.vTime|default=''}" lay-verify="required"    autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
            <td class="layui-td-gray-2">联系方式<font>*</font>
            </td>
            <td>
                <input type="text" name="vType" value="{$detail.vType|default=''}" lay-verify="required"  autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
            <td class="layui-td-gray">销售员<font>*</font>
            </td>
            <td>
                <select name="saleId" xm-select="selectId" lay-search>
                    {if isset($detail.saleId)}
                    {volist name="adminList" id= 'al'}
                    <option value="{$al.id}" {if $al.id==$detail.saleId} selected {/if}>{$al.name}</option>
                    {/volist}
                    {else}
                    {volist name="adminList" id= 'al'}
                    <option value="{$al.id}" {if session('gougu_admin')==$al.id} selected {/if}>{$al.name}</option>
                    {/volist}
                    {/if}
                </select>
            </td>
        </tr>
        <tr>


            <td class="layui-td-gray-2">洽谈事项<font>*</font>
            </td>
            <td colspan="5">
                <textarea name="content"  cols="80" rows="10">{$detail.content|default=''}</textarea>
            </td>
        </tr>
    </table>
    <div class="py-3">
        <input type="hidden" name="id" value="{$id}">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">保存</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}

<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var form = layui.form,tool=layui.tool,level=0,laydate = layui.laydate;
        //监听提交
        form.on('submit(webform)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    setTimeout(function(){
                        parent.parent.location.reload();
                    },1000);
                }
            }
            tool.post("{:url('add')}", data.field, callback);
            return false;
        });
        laydate.render({
            elem: '#vTime' ,// 指定元素
            type:'datetime',
        });
    }
</script>
{/block}
<!-- /脚本 -->